%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Program: load_data.m
% Purpose: Load data for ALO rust belt project
% By:      David Lagakos
% Date:    05-31-21
% Input:   rb_data_input.xls file with all the raw data used in the project
% Output:  matlab variables with raw data used in the project
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Read raw Rust Belt data
dataFile = 'rb_data_input.xlsx';

%load STATA data from Excel file
%%[scfRaw,varNamesRaw] = xlsread(stataFile);
[dataRaw,varNamesRaw] = xlsread(dataFile,'numerical');

% record num obs
[rows_dataRaw cols_dataRaw] = size(dataRaw);

% Assign var names
year = dataRaw(:,1);
emp_share_RB_data = dataRaw(:,2);
mfg_emp_share_RB_data = dataRaw(:,3);
va_share_RB_data = dataRaw(:,4);
mfg_va_share_RB_data = dataRaw(:,5);
service_emp_share_data = dataRaw(:,6);
rb_mfg_dummy_data = dataRaw(:,7);
rb_mfg_simple_ratio_data = dataRaw(:,8);
roc_mfg_w_data = dataRaw(:,9);
rb_mfg_w_data = dataRaw(:,10);
autos_import_share_data = dataRaw(:,11);
steel_import_share_data = dataRaw(:,12);
aggregate_import_share_data = dataRaw(:,13);
autos_steel_data = dataRaw(:,14);
import_shares_RB_Feenstra_data = dataRaw(:,15);
import_shares_RB_wtd_avg_data = dataRaw(:,16);
import_shares_RB_wtd_avg_FINAL_data = dataRaw(:,17);
import_shares_US_MFG_100_data = dataRaw(:,18);
import_shares_US_MFG_data = dataRaw(:,19);
clear dataRaw varNamesRaw cols_dataRaw

